package lab02.test20;

import java.util.Scanner;

public class Test20 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        System.out.println("请输入一行含有数字和字符的字符串：");
        String string=in.next();
        StringBuffer stringBuffer=new StringBuffer();
        char tem;
        for(int i=0;i<string.length();i++){
            tem=string.charAt(i);
            if(string.charAt(i)>='0'&&string.charAt(i)<='9'){
                stringBuffer.append(tem);
            }
        }
        System.out.println(stringBuffer);
    }
}
